<?php
/***************************************************************************
 *   Copyright (C) 2007 by Andrea Blankenstijn, David Dieulivol            *
 *   darkan9el@gmail.com, daviddieulivol5@hotmail.com                      *
 *                                                                         *
 *   All rights reserved.                                                  *
 *   This work is released under the terms of the New BSD License.         *
 *   See LICENSE.BSD file for licensing details                            *
 ***************************************************************************/
/* * *
* $Id: gallery.php 49 2007-08-27 18:23:57Z DarkAn9el $
* * */

@$id = $_GET['viewGallery'];

if(!empty($id))
{
	$gallery = new Gallery($odb, $id);
	$date    = strftime('%A, %d %B %Y', strtotime($gallery->getCreationDate()));
	echo '<h1>', $gallery->getName() ,'</h1>';
	echo '<p>', $date ,' <em>', $gallery->getDescription() ,'</em></p>';

	if($pids = $gallery->getIdPhotos())
	{
		$photo = new Photo($odb);

		foreach($pids as $pid)
		{
			$photo->load($pid);

			$date        = strftime('%Y-%m-%d', strtotime($photo->getDate()));
			$imgFile     = $photo->getImageWebPath();
			$name        = $photo->getName();
			$thumbFile   = $photo->getThumbnailWebPath();
	
			echo '<div class="thumbnail">';
			echo '<a href="?viewGallery=', $id,'&amp;viewPhoto=', $pid,'">';
			echo '<img src="',$thumbFile,'" alt="',$name,'"/>';
			echo '</a>';
			echo '<p>',$date,' - ',$name,'</p>';
			echo '</div>';
		}
	}
	else
		echo '<p><em>Galerie vide</em></p>';
}
?>
<p style="clear:both"><em>$Id: gallery.php 49 2007-08-27 18:23:57Z DarkAn9el $</em></p>
